import './assets/main.css'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import plugins from './plugins'

const app = createApp(App)

// 创建 Pinia 实例
const pinia = createPinia();

// 应用持久化插件
pinia.use(piniaPluginPersistedstate);
app.use(pinia);
app.use(router)
app.use(ElementPlus)
app.use(plugins);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')
